package koscom.corebase.main;

import java.awt.Color;
import java.awt.EventQueue;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.PrintWriter;

import javax.swing.JButton;
import javax.swing.JDesktopPane;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class MainScreen {
	JFrame CoreBase;
	JPanel panel;
	
	static Connect con;
	PrintWriter pw;
	static Login frame;
	static MainScreen window;
	private JTextField txtScreen;
	JTextField txtNotice;
	JTextField txtTime;
	private final JDesktopPane desktopPane = new JDesktopPane();
	
	/**
	 * Launch the application.
	 */
	//List<JButton> btnListNam = new ArrayList<JButton>();
	//Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					window = new MainScreen();
//					Thread t1=new Thread(new Run(window, frame, con));
//					t1.start();
//					Thread t2=new Thread(new Time(window));
//					t2.start();
					window.CoreBase.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public MainScreen() {
		//con=new Connect();
		//pw=con.getOutput();
		
//		frame = new Login();
//		frame.pw = pw;
//		frame.setVisible(true);
		
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {		
		CoreBase = new JFrame();
		CoreBase.getContentPane().setBackground(Color.WHITE);
		CoreBase.setIconImage(Toolkit.getDefaultToolkit().getImage("C:\\Documents and Settings\\User\\바탕 화면\\symbol.png"));
		CoreBase.setFont(new Font("Arial Black", Font.PLAIN, 12));
		CoreBase.setTitle("CoreBASE 1.0");
		CoreBase.setBounds(100, 100, 904, 592);
		CoreBase.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JMenuBar menuBar = new JMenuBar();
		CoreBase.setJMenuBar(menuBar);
		
		JMenu mnNewMenu = new JMenu("계좌");
		mnNewMenu.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(mnNewMenu);
		
		JMenuItem mntmNewMenuItem = new JMenuItem("1001 | 고객정보 등록 및 변경");
		mnNewMenu.add(mntmNewMenuItem);
		
		JMenuItem mntmNewMenuItem_1 = new JMenuItem("1002 | 종합계좌등록");
		mnNewMenu.add(mntmNewMenuItem_1);
		
		JMenuItem menuItem = new JMenuItem("1003 | 위탁계좌등록");
		mnNewMenu.add(menuItem);
		
		JMenuItem mntmNewMenuItem_2 = new JMenuItem("1004 | 선물계좌등록");
		mnNewMenu.add(mntmNewMenuItem_2);
		
		JMenuItem mntmNewMenuItem_5 = new JMenuItem("1005 | 종합계좌조회");
		mnNewMenu.add(mntmNewMenuItem_5);
		
		JMenuItem menuItem_2 = new JMenuItem("2001 | 계좌사고등록/해지");
		mnNewMenu.add(menuItem_2);
		
		JMenuItem mntmNewMenuItem_3 = new JMenuItem("2002 | 계좌처분제한등록/해지");
		mnNewMenu.add(mntmNewMenuItem_3);
		
		JMenuItem menuItem_3 = new JMenuItem("2003 | 계좌질권설정");
		mnNewMenu.add(menuItem_3);
		
		JMenuItem mntmNewMenuItem_4 = new JMenuItem("2004 | 계좌사고등록및해지내역");
		mnNewMenu.add(mntmNewMenuItem_4);
		
		JMenuItem menuItem_6 = new JMenuItem("5006 | 선물연계약정등록/해지");
		mnNewMenu.add(menuItem_6);
		
		JMenuItem mntmNewMenuItem_6 = new JMenuItem("5007 | 계좌약정등록및해지내역");
		mnNewMenu.add(mntmNewMenuItem_6);
		
		JMenuItem menuItem_4 = new JMenuItem("5008 | 지점계좌서비스약정현황");
		mnNewMenu.add(menuItem_4);
		
		JMenuItem menuItem_5 = new JMenuItem("5009 | 선물대용잔고현황");
		mnNewMenu.add(menuItem_5);
		
		JMenu mnNewMenu_1 = new JMenu("매매/체결");
		mnNewMenu_1.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(mnNewMenu_1);
		
		JMenuItem menuItem_1 = new JMenuItem("1000 | 종합매수주문");
		mnNewMenu_1.add(menuItem_1);
		
		JMenuItem mntmNewMenuItem_10 = new JMenuItem("2000 | 종합매도주문");
		mnNewMenu_1.add(mntmNewMenuItem_10);
		
		JMenu mnNewMenu_2 = new JMenu("출납");
		mnNewMenu_2.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(mnNewMenu_2);
		
		JMenuItem mntmNewMenuItem_7 = new JMenuItem("3001 | 입금");
		mnNewMenu_2.add(mntmNewMenuItem_7);
		
		JMenuItem menuItem_9 = new JMenuItem("3002 | 출금");
		mnNewMenu_2.add(menuItem_9);
		
		JMenuItem menuItem_12 = new JMenuItem("3003 | 입금취소");
		mnNewMenu_2.add(menuItem_12);
		
		JMenuItem menuItem_10 = new JMenuItem("3004 | 출금취소");
		mnNewMenu_2.add(menuItem_10);
		
		JMenuItem menuItem_11 = new JMenuItem("4001 | 입고");
		mnNewMenu_2.add(menuItem_11);
		
		JMenuItem mntmNewMenuItem_8 = new JMenuItem("4002 | 출고");
		mnNewMenu_2.add(mntmNewMenuItem_8);
		
		JMenuItem menuItem_13 = new JMenuItem("4003 | 입고취소");
		mnNewMenu_2.add(menuItem_13);
		
		JMenuItem menuItem_8 = new JMenuItem("4004 | 출고취소");
		mnNewMenu_2.add(menuItem_8);
		
		JMenuItem menuItem_14 = new JMenuItem("4005 | 잔고증명서");
		mnNewMenu_2.add(menuItem_14);
		
		JMenuItem menuItem_16 = new JMenuItem("4007 | 미수/변제내역조회");
		mnNewMenu_2.add(menuItem_16);
		
		JMenuItem menuItem_21 = new JMenuItem("5001 | 선물대용용지정/해지");
		mnNewMenu_2.add(menuItem_21);
		
		JMenuItem mntmNewMenuItem_9 = new JMenuItem("5002 | 보호예수및처분제한설정/해지");
		mnNewMenu_2.add(mntmNewMenuItem_9);
		
		JMenuItem menuItem_22 = new JMenuItem("5003 | 계좌보호예수지정내역");
		mnNewMenu_2.add(menuItem_22);
		
		JMenuItem menuItem_20 = new JMenuItem("5004 | 예수금조회");
		mnNewMenu_2.add(menuItem_20);
		
		JMenu mnNewMenu_3 = new JMenu("결제");
		mnNewMenu_3.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(mnNewMenu_3);
		
		JMenuItem menuItem_15 = new JMenuItem("5005 | 실시간매매정리내역");
		mnNewMenu_3.add(menuItem_15);
		
		JMenuItem menuItem_19 = new JMenuItem("4008 | 지점계좌별결제내역");
		mnNewMenu_3.add(menuItem_19);
		
		JMenuItem menuItem_17 = new JMenuItem("3005 | 지점반대매매대상계좌현황");
		mnNewMenu_3.add(menuItem_17);
		
		JMenuItem menuItem_18 = new JMenuItem("3006 | 계좌별반대매매대상선정현황");
		mnNewMenu_3.add(menuItem_18);
		
		JMenu mnNewMenu_4 = new JMenu("시세");
		mnNewMenu_4.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(mnNewMenu_4);
		
		JMenuItem menuItem_7 = new JMenuItem("3000 | 오춘교");
		mnNewMenu_4.add(menuItem_7);
		
		JMenuItem menuItem_23 = new JMenuItem("4000 | 임경혁");
		mnNewMenu_4.add(menuItem_23);
		
		JMenuItem mntmNewMenuItem_11 = new JMenuItem("5000 | 안형준");
		mnNewMenu_4.add(mntmNewMenuItem_11);
		
		JMenu mnNewMenu_5 = new JMenu("운영");
		mnNewMenu_5.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(mnNewMenu_5);
		
		JMenuItem mntmNewMenuItem_12 = new JMenuItem("6001 | 장시작");
		mnNewMenu_5.add(mntmNewMenuItem_12);
		
		JMenuItem menuItem_25 = new JMenuItem("6002 | 장종료");
		mnNewMenu_5.add(menuItem_25);
		
		JMenuItem menuItem_27 = new JMenuItem("6003 | 일일매매정리");
		mnNewMenu_5.add(menuItem_27);
		
		JMenuItem mntmNewMenuItem_13 = new JMenuItem("6004 | 결제");
		mnNewMenu_5.add(mntmNewMenuItem_13);
		
		JMenuItem menuItem_26 = new JMenuItem("6005 | 반대매매선정");
		mnNewMenu_5.add(menuItem_26);
		
		
		panel = new JPanel();
	    panel.setOpaque(true);
	    
		panel.setBackground(new Color(195,217,235));
		panel.setBounds(0, -1, 897, 43);
		CoreBase.getContentPane().add(panel);
		panel.setLayout(null);
		

		
//임경혁 	
		final JButton brj09 = new JButton("A9");
		brj09.setBounds(574, 4, 57, 36);
		panel.add(brj09);
		brj09.setVisible(false);
		
		final JButton brj08 = new JButton("A8");
		brj08.setBounds(514, 4, 57, 36);
		panel.add(brj08);
		brj08.setVisible(false);
		
		final JButton brj07 = new JButton("A7");
		brj07.setBounds(454, 4, 57, 36);
		panel.add(brj07);
		brj07.setVisible(false);
		
		final JButton brj06 = new JButton("A6");
		brj06.setBounds(393, 4, 57, 36);
		panel.add(brj06);
		brj06.setVisible(false);
		
		final JButton brj05 = new JButton("A5");
		brj05.setBounds(333, 4, 57, 36);
		panel.add(brj05);
		brj05.setVisible(false);
		
		final JButton brj04 = new JButton("A4");
		brj04.setBounds(272, 4, 57, 36);
		panel.add(brj04);
		brj04.setVisible(false);
		
		final JButton brj03 = new JButton("A3");
		brj03.setBounds(212, 4, 57, 36);
		panel.add(brj03);
		brj03.setVisible(false);
		
		final JButton brj02 = new JButton("A2");
		brj02.setBounds(152, 4, 57, 36);
		panel.add(brj02);
		brj02.setVisible(false);
		
		final JButton brj01 = new JButton("A1");
		brj01.setBounds(92, 4, 57, 36);
		panel.add(brj01);
		brj01.setVisible(false);
//임경혁 	
		final JButton lim09 = new JButton("L9");
		lim09.setBounds(574, 4, 57, 36);
		panel.add(lim09);
		lim09.setVisible(false);
		
		final JButton lim08 = new JButton("L8");
		lim08.setBounds(514, 4, 57, 36);
		panel.add(lim08);
		lim08.setVisible(false);
		
		final JButton lim07 = new JButton("L7");
		lim07.setBounds(454, 4, 57, 36);
		panel.add(lim07);
		lim07.setVisible(false);
		
		final JButton lim06 = new JButton("L6");
		lim06.setBounds(393, 4, 57, 36);
		panel.add(lim06);
		lim06.setVisible(false);
		
		final JButton lim05 = new JButton("L5");
		lim05.setBounds(333, 4, 57, 36);
		panel.add(lim05);
		lim05.setVisible(false);
		
		final JButton lim04 = new JButton("L4");
		lim04.setBounds(272, 4, 57, 36);
		panel.add(lim04);
		lim04.setVisible(false);
		
		final JButton lim03 = new JButton("L3");
		lim03.setBounds(212, 4, 57, 36);
		panel.add(lim03);
		lim03.setVisible(false);
		
		final JButton lim02 = new JButton("L2");
		lim02.setBounds(152, 4, 57, 36);
		panel.add(lim02);
		lim02.setVisible(false);
		
		final JButton lim01 = new JButton("L1");
		lim01.setBounds(92, 4, 57, 36);
		panel.add(lim01);
		lim01.setVisible(false);
//오춘교 	
		final JButton oh09 = new JButton("09");
		oh09.setBounds(574, 4, 57, 36);
		panel.add(oh09);
		oh09.setVisible(false);
		
		final JButton oh08 = new JButton("08");
		oh08.setBounds(514, 4, 57, 36);
		panel.add(oh08);
		oh08.setVisible(false);
		
		final JButton oh07 = new JButton("07");
		oh07.setBounds(454, 4, 57, 36);
		panel.add(oh07);
		oh07.setVisible(false);
		
		final JButton oh06 = new JButton("06");
		oh06.setBounds(393, 4, 57, 36);
		panel.add(oh06);
		oh06.setVisible(false);
		
		final JButton oh05 = new JButton("05");
		oh05.setBounds(333, 4, 57, 36);
		panel.add(oh05);
		oh05.setVisible(false);
		
		final JButton oh04 = new JButton("04");
		oh04.setBounds(272, 4, 57, 36);
		panel.add(oh04);
		oh04.setVisible(false);
		
		final JButton oh03 = new JButton("03");
		oh03.setBounds(212, 4, 57, 36);
		panel.add(oh03);
		oh03.setVisible(false);
		
		final JButton oh02 = new JButton("02");
		oh02.setBounds(152, 4, 57, 36);
		panel.add(oh02);
		oh02.setVisible(false);
		
		final JButton oh01 = new JButton("01");
		oh01.setBounds(92, 4, 57, 36);
		panel.add(oh01);
		oh01.setVisible(false);
//남송학
		final JButton nam09 = new JButton("N9");
		nam09.setBounds(574, 4, 57, 36);
		panel.add(nam09);
		nam09.setVisible(false);
		
		final JButton nam08 = new JButton("N8");
		nam08.setBounds(514, 4, 57, 36);
		panel.add(nam08);
		nam08.setVisible(false);
		
		final JButton nam07 = new JButton("N7");
		nam07.setBounds(454, 4, 57, 36);
		panel.add(nam07);
		nam07.setVisible(false);
		
		final JButton nam06 = new JButton("N6");
		nam06.setBounds(393, 4, 57, 36);
		panel.add(nam06);
		nam06.setVisible(false);
		
		final JButton nam05 = new JButton("N5");
		nam05.setBounds(333, 4, 57, 36);
		panel.add(nam05);
		nam05.setVisible(false);
		
		final JButton nam04 = new JButton("N4");
		nam04.setBounds(272, 4, 57, 36);
		panel.add(nam04);
		nam04.setVisible(false);
		
		final JButton nam03 = new JButton("N3");
		nam03.setBounds(212, 4, 57, 36);
		panel.add(nam03);
		nam03.setVisible(false);
		
		final JButton nam02 = new JButton("N2");
		nam02.setBounds(152, 4, 57, 36);
		panel.add(nam02);
		nam02.setVisible(false);
		
		final JButton nam01 = new JButton("N1");
		nam01.setBounds(92, 4, 57, 36);
		panel.add(nam01);
		nam01.setVisible(false);
		
//전원기
		final JButton won09 = new JButton("W9");
		won09.setBounds(574, 4, 57, 36);
		panel.add(won09);
		won09.setVisible(false);
		
		final JButton won08 = new JButton("W8");
		won08.setBounds(514, 4, 57, 36);
		panel.add(won08);
		won08.setVisible(false);
		
		final JButton won07 = new JButton("W7");
		won07.setBounds(454, 4, 57, 36);
		panel.add(won07);
		won07.setVisible(false);
		
		final JButton won06 = new JButton("W6");
		won06.setBounds(393, 4, 57, 36);
		panel.add(won06);
		won06.setVisible(false);
		
		final JButton won05 = new JButton("W5");
		won05.setBounds(333, 4, 57, 36);
		panel.add(won05);
		won05.setVisible(false);
		
		final JButton won04 = new JButton("W4");
		won04.setBounds(272, 4, 57, 36);
		panel.add(won04);
		won04.setVisible(false);
		
		final JButton won03 = new JButton("W3");
		won03.setBounds(212, 4, 57, 36);
		panel.add(won03);
		won03.setVisible(false);
		
		final JButton won02 = new JButton("W2");
		won02.setBounds(152, 4, 57, 36);
		panel.add(won02);
		won02.setVisible(false);
		
		final JButton won01 = new JButton("W1");
		won01.setBounds(92, 4, 57, 36);
		panel.add(won01);
		won01.setVisible(false);

		
			
		
		JMenu menu = new JMenu("툴바");
		menu.setFont(new Font("맑은 고딕", Font.PLAIN, 12));
		menuBar.add(menu);
		
		JMenuItem menuItem_24 = new JMenuItem("1*** | 전원기");
		menuItem_24.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				
				won01.setVisible(true);
				won02.setVisible(true);
				won03.setVisible(true);
				won04.setVisible(true);
				won05.setVisible(true);
				won06.setVisible(true);
				won07.setVisible(true);
				won08.setVisible(true);
				won09.setVisible(true);
				
			}
		});
		menu.add(menuItem_24);
		
		JMenuItem menuItem_30 = new JMenuItem("2*** | 남송학");
		menuItem_30.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				
				nam01.setVisible(true);
				nam02.setVisible(true);
				nam03.setVisible(true);
				nam04.setVisible(true);
				nam05.setVisible(true);
				nam06.setVisible(true);
				nam07.setVisible(true);
				nam08.setVisible(true);
				nam09.setVisible(true);
			}
		});
		menu.add(menuItem_30);
		
		JMenuItem mntmNewMenuItem_14 = new JMenuItem("3*** | 오춘교");
		mntmNewMenuItem_14.addMouseListener(new MouseAdapter() {
			
			@Override
			public void mouseReleased(MouseEvent e) {
				oh01.setVisible(true);
				oh02.setVisible(true);
				oh03.setVisible(true);
				oh04.setVisible(true);
				oh05.setVisible(true);
				oh06.setVisible(true);
				oh07.setVisible(true);
				oh08.setVisible(true);
				oh09.setVisible(true);
			}
		});
		menu.add(mntmNewMenuItem_14);
		
		JMenuItem menuItem_29 = new JMenuItem("4*** | 임경혁");
		menuItem_29.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				lim01.setVisible(true);
				lim02.setVisible(true);
				lim03.setVisible(true);
				lim04.setVisible(true);
				lim05.setVisible(true);
				lim06.setVisible(true);
				lim07.setVisible(true);
				lim08.setVisible(true);
				lim09.setVisible(true);
			}
		});
		menu.add(menuItem_29);
		
		JMenuItem menuItem_28 = new JMenuItem("5*** | 안형준");
		menuItem_28.addMouseListener(new MouseAdapter() {
			@Override
			public void mouseReleased(MouseEvent e) {
				brj01.setVisible(true);
				brj02.setVisible(true);
				brj03.setVisible(true);
				brj04.setVisible(true);
				brj05.setVisible(true);
				brj06.setVisible(true);
				brj07.setVisible(true);
				brj08.setVisible(true);
				brj09.setVisible(true);
				
			}
		});
		menu.add(menuItem_28);
		CoreBase.getContentPane().setLayout(null);
		
		JLabel lblSearch = new JLabel("Search");
		lblSearch.setFont(new Font("맑은 고딕", Font.PLAIN, 10));
		lblSearch.setBounds(6, 3, 45, 15);
		panel.add(lblSearch);
		
		txtScreen = new JTextField();
		txtScreen.setBounds(6, 17, 74, 21);
		panel.add(txtScreen);
		txtScreen.setColumns(10);

		txtNotice = new JTextField();
		txtNotice.setEnabled(false);
		txtNotice.setBounds(0, 514, 749, 21);
		CoreBase.getContentPane().add(txtNotice);
		txtNotice.setColumns(10);
		
		txtTime = new JTextField();
		txtTime.setEnabled(false);
		txtTime.setColumns(10);
		txtTime.setBounds(747, 514, 150, 21);
		CoreBase.getContentPane().add(txtTime);
		desktopPane.setBackground(Color.WHITE);
		desktopPane.setBounds(10, 48, 874, 456);
		CoreBase.getContentPane().add(desktopPane);
		
	}
}
